package com.sykj.manage.service.imp;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sykj.manage.dao.BisConfigDao;
import com.sykj.manage.service.BisConfigService;
import com.sykj.manage.model.BisConfig;
import com.sykj.manage.model.BisShopCustom;
import com.sykj.manage.model.SysParam;
@Service
public class BisConfigServiceImp implements BisConfigService{

	@Autowired
	BisConfigDao bisConfigDao;
	
	@Override
	public List<BisConfig> getall() {
		// TODO Auto-generated method stub
		return bisConfigDao.getall();
	}

	@Override
	public void add(BisConfig bisconfig) {
		// TODO Auto-generated method stub
		bisConfigDao.add(bisconfig);
	}

	@Override
	public int updateBis(BisConfig bisConfig) {
		// TODO Auto-generated method stub
		return bisConfigDao.updateBis(bisConfig);
	}

	
	@Override
	public int deleteConfig(String config_id) {
		// TODO Auto-generated method stub
		return bisConfigDao.deleteConfig(config_id);
	}

	@Override
	public BisConfig updatecx(String config_id) {
		// TODO Auto-generated method stub
		return bisConfigDao.updatecx(config_id);
	}

	@Override
	public SysParam getparam() {
		// TODO Auto-generated method stub
		return bisConfigDao.getparam();
	}

	@Override
	public SysParam getparams() {
		// TODO Auto-generated method stub
		return bisConfigDao.getparams();
	}
	
	/**
	 * 实现持久层根据id查的接口
	 */
	@Override
	public Map<String, SysParam> allSysparamdao() {
		
		
			// TODO Auto-generated method stub
			List<SysParam> params = bisConfigDao.allSysparamdao();
			Map<String, SysParam> paramMap = new HashMap<String, SysParam>();
			for (SysParam item : params) {
				paramMap.put(item.getParam_key(), item);
			}
			return paramMap;
		
	}
	/**
	 * 实现持久层修改单个value
	 */

	@Override
	public void updateSysParam(List<SysParam> paramsList) {
		// TODO Auto-generated method stub
		for (SysParam param:paramsList) {
			bisConfigDao.updateSysParam(param);
		}
	}
	
	
	
	

	

}
